package com.itheima.file;

import java.io.File;

/**
 * @author Anomaly
 * @date 2023/2/8 13:20
 */
public class FileDemo {
    public static void main(String[] args) {
        //路径写法：E:\\桌面\\logback类库\\logback.xml
        //        E:/桌面/logback类库/logback.xml
        //  自动提取分隔符
        File file = new File("E:" + File.separator + "桌面" + File.separator + "logback类库" + File.separator + "logback.xml");
        System.out.println(file.exists());
        System.out.println(file.length());      //文件字节大小

        //工程下的相对路径
        File file1 = new File("file-io/src/test.txt");
        System.out.println(file1.exists());
        System.out.println(file1.length());

    }
}
